package demo3;
///Object类
class Person{
    String name;
    int age;
    public Person() {

    }


    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }
}

class Student extends Person{

}

public class Test {

    /// 对象比较equals法
    /// hashCode
    public static void main(String[] args) {
        Person person1 = new Person("bit",10);

        Person person2 = new Person("bit",10);

        System.out.println(person1.hashCode());
        System.out.println(person2.hashCode());
        System.out.println("================");
        System.out.println(person1.equals(person2));
    }

    public static void main2(String[] args) {
        Person object = new Person();
        object.name = "bite";
        System.out.println(object.name);
    }

    public static void main1(String[] args) {
        Object object = new Person();
        Object o = new Student();
    }
}
